
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="westh.cl.access.hibernate.Menu"%>
<%@ page import="westh.cl.access.bo.MenuBO"%>
<jsp:include page="../inc-auth.jsp" />

<%
List menus = (List) request.getSession().getAttribute("mboVisibleList");
String applicationHomepage = westh.config.Config.get("ApplicationHomepage");
%>

<html>
<head>
    <%@ include file="../inc-path.jsp" %>
    <title>菜单</title>
    <script type="text/javascript" src="js/left-menu.js"></script>
    <style type="text/css">
        body  { background:#799AE1; margin:0px; font:9pt 宋体; }
        table  { border:0px; }
        td  { font:normal 12px 宋体; }
        img  { vertical-align:bottom; border:0px; }
        a  { font:normal 12px 宋体; color:#000000; text-decoration:none; }
        a:hover  { color:#428EFF;text-decoration:underline; }
        .sec_menu  { border-left:1px solid white; border-right:1px solid white; 
            border-bottom:1px solid white; overflow:hidden; background:#D6DFF7; }
        .menu_title  { }
        .menu_title span  { position:relative; top:2px; left:8px; color:#215DC6; 
            font-weight:bold; }
        .menu_title2  { }
        .menu_title2 span  { position:relative; top:2px; left:8px; color:#428EFF; 
            font-weight:bold; }
    </style>
</head>

<body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0"	onload="showall()">
<script language="JavaScript">
  totalNum = <%=menus.size()+1%>;
</script>
<table width="100%" cellpadding="0" cellspacing="0" border="0"
	align="left">
	<tr>
		<td valign="top">
		<table cellpadding="0" cellspacing="0" width="150" align="center">
			<tr>
				<td height="42" valign="bottom"><img src="image/title.gif"
					width="158" height="38" onclick="showall()"></td>
			</tr>
		</table>
		<table cellpadding="0" cellspacing="0" width="158" align="center">
			<tr>
				<td height="25" class="menu_title"
					onmouseover="this.className='menu_title2';"
					onmouseout="this.className='menu_title';"
					background="image/title_bg_quit.gif"><span>
                    <a href="<%=applicationHomepage%>" target="main"><b>首页</b></a>|<a
                    href="jsp/login.jsp" target="_top"><b>退出</b></a>|<a
                    onclick="hideall()" style="cursor:pointer;"><b>展开</b></a>|<a
                    onclick="showall()" style="cursor:pointer"><b>收缩</b>
                    </a></span></td>
			</tr>
		</table>
<%
System.out.println("Total Number=" + menus.size());
for (int i=0;i<menus.size();i++) {
    MenuBO mbo = (MenuBO) menus.get(i);
    Menu m = mbo.getMenu();
//    System.out.println(" " + m.getTitle());
%>
		<table width="158" align="center" cellpadding="0" cellspacing="0">
			<tr>
				<td height="25" class="menu_title"
					onmouseover="this.className='menu_title2';"
					onmouseout="this.className='menu_title';"
					background="image/menu_left_item.gif" id="menuTitle1"
					onclick="showsubmenu(<%=i+1%>)">
                    <a style="cursor:pointer;text-decoration: none">
                        <span><%=m.getTitle()%></span>
                    </a>
                </td>
			</tr>
<%
    List submenus = mbo.getMenuList();
    if (submenus != null) {
%>            
			<tr>
				<td style="display:" id='submenu_<%=i+1%>'>
				<div class="sec_menu" style="width:158">
				<table cellpadding="0" cellspacing="0" align="center" width="135">
<%
        int j=0;
//        System.out.println(" submenu size=" + submenus.size());
        while (j<(submenus.size())) {
%>
					<tr>
						<td height="20">
<%
            int k = 0;
            while (j < (submenus.size())) {
                Menu subm = ((MenuBO)submenus.get(j)).getMenu();
//                System.out.println(" submenuTitle =" + subm.getTitle());
                j++;k++;
                if (subm.getTitle().equalsIgnoreCase("----")) { break;}
                if (k > 1) { out.write("|"); }
%>                        
                          <a href="redirect.jsp?url=<%=subm.getUrl()%>" target="main"><%=subm.getTitle()%></a>
<%
            }
%>                          
                        </td>
					</tr>
<%
        }
%>                    
				</table>
				</div>
				&nbsp;</td>
			</tr>
		</table>
<%
    }
}%>

		<table cellpadding="0" cellspacing="0" width="158" align="center">
			<tr>
				<td height="25" class="menu_title"
					onmouseover="this.className='menu_title2';"
					onmouseout="this.className='menu_title';"
					background="image/menu_left_item.gif" id="menuTitle1"><span>版权信息</span></td>
			</tr>
			<tr>
				<td>
				<div class="sec_menu" style="width:158">
				<table cellpadding="0" cellspacing="0" align="center" width="135">
					<tr>
						<td height="20">&nbsp;<br>
						版权所有:清华大学<br>
						<br>
						技术支持:清华大学信息技术研究院Web与软件技术研究中心<br>
						<br>
                            如有问题，请联系<a style="text-decoration: underline" href="mailto:dagege@gmail.com">管理员</a><br>
						<br>
						</td>
					</tr>
				</table>
				</div>
				</td>
			</tr>
		</table>
		</td>
	</tr>
</table>
</body>
</html>
